import os
import math
import sys

mbits=15
trans=10000

num=1<<mbits

arr=[0 for i in range(num)]

flr=1

print("num: "+str(num))

for i in range(1,trans+1):
    if i > flr:
        flr*=2
    tot = 0
    for j in range(num):
        k = j % flr
        if k < i:
            pos = k
        else :
            pos = k - flr/2
        if arr[j] != pos:
            tot += 1
        arr[j] = pos
    print("server: "+str(i)+" trans "+str(1.0*tot/num))
        
            
        

